Function Reference

_IEGetObjById

Returns an object variable by id or name.

#include <IE.au3>
_IEGetObjById ( ByRef $o_object, $s_Id)

 

Parameters

$o_object Object variable of an InternetExplorer.Application, Window or Frame object
$s_Id Specifies id or name of the object you wish to match

 

Return Value

Success: Returns an object variable pointing to the specified Object
Failure: Returns 0 and sets @ERROR
@Error: 0 ($_IEStatus_Success) = No Error
3 ($_IEStatus_InvalidDataType) = Invalid Data Type
7 ($_IEStatus_NoMatch) = No Match

 

Remarks

This function will return an object reference to any object in the document with a specified id or name. DOM elements can have Name or ID attributes or both. A specific ID can be assigned to only a single element while a specific Name can be assigned to multiple elements. In Internet Explorer, the Name and ID namespaces are shared.

 

Related

_IEGetObjByName

 

Example


; *******************************************************
; Example 1 - Open a browser to the basic example, get an object reference
;               to the DIV element with the ID "line1". Display the innerText
;               of this element to the console.
; *******************************************************
;
#include <IE.au3>
$oIE = _IE_Example ("basic")
$oDiv = _IEGetObjById ($oIE, "line1")
ConsoleWrite(_IEPropertyGet($oDiv, "innertext") & @CR)